3.828 \(\int \frac{(d \csc (e+f x))^n}{a+b \sin (e+f x)} \, dx\)

Optimal. Leaf size=204 \[ \frac{b \sin (e+f x) \cos (e+f x) \sin ^2(e+f x)^{n/2} (d \csc (e+f x))^{n+1} F_1\left (\frac{1}{2};\frac{n}{2},1;\frac{3}{2};\cos ^2(e+f x),-\frac{b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{d f \left (a^2-b^2\right )}-\frac{a \cos (e+f x) \sin ^2(e+f x)^{\frac{n+1}{2}} (d \csc (e+f x))^{n+1} F_1\left (\frac{1}{2};\frac{n+1}{2},1;\frac{3}{2};\cos ^2(e+f x),-\frac{b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{d f \left (a^2-b^2\right )} \]

[Out]

(b*AppellF1[1/2, n/2, 1, 3/2, Cos[e + f*x]^2, -((b^2*Cos[e + f*x]^2)/(a^2 - b^2))]*Cos[e + f*x]*(d*Csc[e + f*x
])^(1 + n)*Sin[e + f*x]*(Sin[e + f*x]^2)^(n/2))/((a^2 - b^2)*d*f) - (a*AppellF1[1/2, (1 + n)/2, 1, 3/2, Cos[e
+ f*x]^2, -((b^2*Cos[e + f*x]^2)/(a^2 - b^2))]*Cos[e + f*x]*(d*Csc[e + f*x])^(1 + n)*(Sin[e + f*x]^2)^((1 + n)
/2))/((a^2 - b^2)*d*f)

________________________________________________________________________________________

Rubi [A]  time = 0.398981, antiderivative size = 204, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {3238, 3869, 2823, 3189, 429} \[ \frac{b \sin (e+f x) \cos (e+f x) \sin ^2(e+f x)^{n/2} (d \csc (e+f x))^{n+1} F_1\left (\frac{1}{2};\frac{n}{2},1;\frac{3}{2};\cos ^2(e+f x),-\frac{b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{d f \left (a^2-b^2\right )}-\frac{a \cos (e+f x) \sin ^2(e+f x)^{\frac{n+1}{2}} (d \csc (e+f x))^{n+1} F_1\left (\frac{1}{2};\frac{n+1}{2},1;\frac{3}{2};\cos ^2(e+f x),-\frac{b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{d f \left (a^2-b^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[(d*Csc[e + f*x])^n/(a + b*Sin[e + f*x]),x]

[Out]

(b*AppellF1[1/2, n/2, 1, 3/2, Cos[e + f*x]^2, -((b^2*Cos[e + f*x]^2)/(a^2 - b^2))]*Cos[e + f*x]*(d*Csc[e + f*x
])^(1 + n)*Sin[e + f*x]*(Sin[e + f*x]^2)^(n/2))/((a^2 - b^2)*d*f) - (a*AppellF1[1/2, (1 + n)/2, 1, 3/2, Cos[e
+ f*x]^2, -((b^2*Cos[e + f*x]^2)/(a^2 - b^2))]*Cos[e + f*x]*(d*Csc[e + f*x])^(1 + n)*(Sin[e + f*x]^2)^((1 + n)
/2))/((a^2 - b^2)*d*f)

Rule 3238

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^(n_.))^(p_.), x_Symbol] :> Dist
[d^(n*p), Int[(d*Csc[e + f*x])^(m - n*p)*(b + a*Csc[e + f*x]^n)^p, x], x] /; FreeQ[{a, b, d, e, f, m, n, p}, x
] &&  !IntegerQ[m] && IntegersQ[n, p]

Rule 3869

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Dist[Sin[
e + f*x]^n*(d*Csc[e + f*x])^n, Int[(b + a*Sin[e + f*x])^m/Sin[e + f*x]^(m + n), x], x] /; FreeQ[{a, b, d, e, f
, n}, x] && NeQ[a^2 - b^2, 0] && IntegerQ[m]

Rule 2823

Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[a, Int[(d*
Sin[e + f*x])^n/(a^2 - b^2*Sin[e + f*x]^2), x], x] - Dist[b/d, Int[(d*Sin[e + f*x])^(n + 1)/(a^2 - b^2*Sin[e +
 f*x]^2), x], x] /; FreeQ[{a, b, d, e, f, n}, x] && NeQ[a^2 - b^2, 0]

Rule 3189

Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff
 = FreeFactors[Cos[e + f*x], x]}, -Dist[(ff*d^(2*IntPart[(m - 1)/2] + 1)*(d*Sin[e + f*x])^(2*FracPart[(m - 1)/
2]))/(f*(Sin[e + f*x]^2)^FracPart[(m - 1)/2]), Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b - b*ff^2*x^2)^p, x]
, x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] &&  !IntegerQ[m]

Rule 429

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[a^p*c^q*x*AppellF1[1/n, -p,
 -q, 1 + 1/n, -((b*x^n)/a), -((d*x^n)/c)], x] /; FreeQ[{a, b, c, d, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n
, -1] && (IntegerQ[p] || GtQ[a, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rubi steps

\begin{align*} \int \frac{(d \csc (e+f x))^n}{a+b \sin (e+f x)} \, dx &=\frac{\int \frac{(d \csc (e+f x))^{1+n}}{b+a \csc (e+f x)} \, dx}{d}\\ &=\frac{\left ((d \csc (e+f x))^{1+n} \sin ^{1+n}(e+f x)\right ) \int \frac{\sin ^{-n}(e+f x)}{a+b \sin (e+f x)} \, dx}{d}\\ &=\frac{\left (a (d \csc (e+f x))^{1+n} \sin ^{1+n}(e+f x)\right ) \int \frac{\sin ^{-n}(e+f x)}{a^2-b^2 \sin ^2(e+f x)} \, dx}{d}-\frac{\left (b (d \csc (e+f x))^{1+n} \sin ^{1+n}(e+f x)\right ) \int \frac{\sin ^{1-n}(e+f x)}{a^2-b^2 \sin ^2(e+f x)} \, dx}{d}\\ &=-\frac{\left (a (d \csc (e+f x))^{1+n} \sin ^{1+2 \left (-\frac{1}{2}-\frac{n}{2}\right )+n}(e+f x) \sin ^2(e+f x)^{\frac{1}{2}+\frac{n}{2}}\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{\frac{1}{2} (-1-n)}}{a^2-b^2+b^2 x^2} \, dx,x,\cos (e+f x)\right )}{d f}+\frac{\left (b (d \csc (e+f x))^{1+n} \sin (e+f x) \sin ^2(e+f x)^{n/2}\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{-n/2}}{a^2-b^2+b^2 x^2} \, dx,x,\cos (e+f x)\right )}{d f}\\ &=\frac{b F_1\left (\frac{1}{2};\frac{n}{2},1;\frac{3}{2};\cos ^2(e+f x),-\frac{b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) (d \csc (e+f x))^{1+n} \sin (e+f x) \sin ^2(e+f x)^{n/2}}{\left (a^2-b^2\right ) d f}-\frac{a F_1\left (\frac{1}{2};\frac{1+n}{2},1;\frac{3}{2};\cos ^2(e+f x),-\frac{b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) (d \csc (e+f x))^{1+n} \sin ^2(e+f x)^{\frac{1+n}{2}}}{\left (a^2-b^2\right ) d f}\\ \end{align*}

Mathematica [B]  time = 16.9243, size = 1668, normalized size = 8.18 \[ \text{result too large to display} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[(d*Csc[e + f*x])^n/(a + b*Sin[e + f*x]),x]

[Out]

-(((d*Csc[e + f*x])^n*(Cot[e + f*x]*Sqrt[Sec[e + f*x]^2])^n*Tan[e + f*x]*(a*b*(-2 + n)*AppellF1[(1 - n)/2, -n/
2, 1, (3 - n)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^2] + (-1 + n)*((a^2 - b^2)*AppellF1[1 - n/2, (-1
 - n)/2, 1, 2 - n/2, -Tan[e + f*x]^2, ((-a^2 + b^2)*Tan[e + f*x]^2)/a^2] - a^2*Hypergeometric2F1[1/2 - n/2, 1
- n/2, 2 - n/2, -Tan[e + f*x]^2])*Tan[e + f*x]))/(a^2*b*f*(-2 + n)*(-1 + n)*(Sec[e + f*x]^2)^(n/2)*(a + b*Sin[
e + f*x])*(-(((Sec[e + f*x]^2)^(1 - n/2)*(Cot[e + f*x]*Sqrt[Sec[e + f*x]^2])^n*(a*b*(-2 + n)*AppellF1[(1 - n)/
2, -n/2, 1, (3 - n)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^2] + (-1 + n)*((a^2 - b^2)*AppellF1[1 - n/
2, (-1 - n)/2, 1, 2 - n/2, -Tan[e + f*x]^2, ((-a^2 + b^2)*Tan[e + f*x]^2)/a^2] - a^2*Hypergeometric2F1[1/2 - n
/2, 1 - n/2, 2 - n/2, -Tan[e + f*x]^2])*Tan[e + f*x]))/(a^2*b*(-2 + n)*(-1 + n))) - (n*(Cot[e + f*x]*Sqrt[Sec[
e + f*x]^2])^(-1 + n)*(Sqrt[Sec[e + f*x]^2] - Csc[e + f*x]^2*Sqrt[Sec[e + f*x]^2])*Tan[e + f*x]*(a*b*(-2 + n)*
AppellF1[(1 - n)/2, -n/2, 1, (3 - n)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^2] + (-1 + n)*((a^2 - b^2
)*AppellF1[1 - n/2, (-1 - n)/2, 1, 2 - n/2, -Tan[e + f*x]^2, ((-a^2 + b^2)*Tan[e + f*x]^2)/a^2] - a^2*Hypergeo
metric2F1[1/2 - n/2, 1 - n/2, 2 - n/2, -Tan[e + f*x]^2])*Tan[e + f*x]))/(a^2*b*(-2 + n)*(-1 + n)*(Sec[e + f*x]
^2)^(n/2)) + (n*(Cot[e + f*x]*Sqrt[Sec[e + f*x]^2])^n*Tan[e + f*x]^2*(a*b*(-2 + n)*AppellF1[(1 - n)/2, -n/2, 1
, (3 - n)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^2] + (-1 + n)*((a^2 - b^2)*AppellF1[1 - n/2, (-1 - n
)/2, 1, 2 - n/2, -Tan[e + f*x]^2, ((-a^2 + b^2)*Tan[e + f*x]^2)/a^2] - a^2*Hypergeometric2F1[1/2 - n/2, 1 - n/
2, 2 - n/2, -Tan[e + f*x]^2])*Tan[e + f*x]))/(a^2*b*(-2 + n)*(-1 + n)*(Sec[e + f*x]^2)^(n/2)) - ((Cot[e + f*x]
*Sqrt[Sec[e + f*x]^2])^n*Tan[e + f*x]*((-1 + n)*((a^2 - b^2)*AppellF1[1 - n/2, (-1 - n)/2, 1, 2 - n/2, -Tan[e
+ f*x]^2, ((-a^2 + b^2)*Tan[e + f*x]^2)/a^2] - a^2*Hypergeometric2F1[1/2 - n/2, 1 - n/2, 2 - n/2, -Tan[e + f*x
]^2])*Sec[e + f*x]^2 + a*b*(-2 + n)*(((1 - n)*n*AppellF1[1 + (1 - n)/2, 1 - n/2, 1, 1 + (3 - n)/2, -Tan[e + f*
x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^2]*Sec[e + f*x]^2*Tan[e + f*x])/(3 - n) + (2*(-1 + b^2/a^2)*(1 - n)*AppellF1
[1 + (1 - n)/2, -n/2, 2, 1 + (3 - n)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^2]*Sec[e + f*x]^2*Tan[e +
 f*x])/(3 - n)) + (-1 + n)*Tan[e + f*x]*((a^2 - b^2)*(-(((-1 - n)*(1 - n/2)*AppellF1[2 - n/2, 1 + (-1 - n)/2,
1, 3 - n/2, -Tan[e + f*x]^2, ((-a^2 + b^2)*Tan[e + f*x]^2)/a^2]*Sec[e + f*x]^2*Tan[e + f*x])/(2 - n/2)) + (2*(
-a^2 + b^2)*(1 - n/2)*AppellF1[2 - n/2, (-1 - n)/2, 2, 3 - n/2, -Tan[e + f*x]^2, ((-a^2 + b^2)*Tan[e + f*x]^2)
/a^2]*Sec[e + f*x]^2*Tan[e + f*x])/(a^2*(2 - n/2))) - 2*a^2*(1 - n/2)*Csc[e + f*x]*Sec[e + f*x]*(-Hypergeometr
ic2F1[1/2 - n/2, 1 - n/2, 2 - n/2, -Tan[e + f*x]^2] + (1 + Tan[e + f*x]^2)^(-1/2 + n/2)))))/(a^2*b*(-2 + n)*(-
1 + n)*(Sec[e + f*x]^2)^(n/2)))))

________________________________________________________________________________________

Maple [F]  time = 0.493, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( d\csc \left ( fx+e \right ) \right ) ^{n}}{a+b\sin \left ( fx+e \right ) }}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*csc(f*x+e))^n/(a+b*sin(f*x+e)),x)

[Out]

int((d*csc(f*x+e))^n/(a+b*sin(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \csc \left (f x + e\right )\right )^{n}}{b \sin \left (f x + e\right ) + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*csc(f*x+e))^n/(a+b*sin(f*x+e)),x, algorithm="maxima")

[Out]

integrate((d*csc(f*x + e))^n/(b*sin(f*x + e) + a), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\left (d \csc \left (f x + e\right )\right )^{n}}{b \sin \left (f x + e\right ) + a}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*csc(f*x+e))^n/(a+b*sin(f*x+e)),x, algorithm="fricas")

[Out]

integral((d*csc(f*x + e))^n/(b*sin(f*x + e) + a), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \csc{\left (e + f x \right )}\right )^{n}}{a + b \sin{\left (e + f x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*csc(f*x+e))**n/(a+b*sin(f*x+e)),x)

[Out]

Integral((d*csc(e + f*x))**n/(a + b*sin(e + f*x)), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \csc \left (f x + e\right )\right )^{n}}{b \sin \left (f x + e\right ) + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*csc(f*x+e))^n/(a+b*sin(f*x+e)),x, algorithm="giac")

[Out]

integrate((d*csc(f*x + e))^n/(b*sin(f*x + e) + a), x)